/**
 * Created by fangshufeng on 2017/12/26.
 */
import {Modal,Input} from 'antd';
import React from 'react';
const {TextArea} = Input;

export default class MockAddDevelopAlert extends React.Component {

    fixObj = () => {
        let tempObj = this.props.dataSource;
        tempObj.groupName =  tempObj.groupName;
        tempObj.developName = this.refs.developName.textAreaRef.value;
        return  tempObj;
    }

    render() {

        if (Object.keys(this.props.dataSource).length === 0) {
            return (null);
        }  else {
            return (
                <div>
                    <Modal
                        title="新增开发人员"
                        visible={Object.keys(this.props.dataSource).length === 0 ? false : true}
                        onOk={() => this.props.okAction(this.fixObj())}
                        onCancel={() => this.props.hidenAction()}
                        closable={false}
                    >
                        <p>业务线名称:</p>
                        <label style={{fontSize:50}}>{this.props.dataSource.groupName}</label>
                        <p></p>

                        <p >输入开发姓名:</p>
                        <TextArea ref="developName"
                                  autosize={true}
                                  defaultValue={this.props.dataSource.developName}/>
                        <p></p>
                    </Modal>

                </div>
            );
        }
    }
}